package com.bafa.front.presentationbeans.playerhistory;

import java.util.TreeSet;

import com.bafa.front.presentationbeans.MatchBean;
import com.bafa.objects.Match;
import com.bafa.objects.player.Player;
import com.bafa.objects.player.PlayerDivision;
import com.bafa.objects.player.PlayerTeam;
import com.bafa.services.RetrieveServices;

public class DivisionListGoalsBean {
	private TreeSet divisions = new TreeSet();

	public TreeSet getDivisions() {
		return divisions;
	}

	public void setDivisions(TreeSet matches) {
		this.divisions = matches;
	}
	
	
	public DivisionListGoalsBean(String name){
		Player player = RetrieveServices.getPlayer(name);
		PlayerDivision[] players = (PlayerDivision[])player.getDivisionGoals().values().toArray(new PlayerDivision[player.getDivisionGoals().values().size()]);
		for(int i=0;i<players.length;i++){
			this.divisions.add(new DivisionGoalsBean(players[i]));
		}
	}
	
	public DivisionGoalsBean[] divisions(){
		return (DivisionGoalsBean[])divisions.toArray(new DivisionGoalsBean[divisions.size()]);
	}
}
